<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', function () {
    return view('welcome');
});

//判断管理员是否登录
Route::group(['middleware' => 'login'], function()
{

	//后台
	Route::get('/admin/index/index','Admin\IndexController@index');

	//后台管理员管理
	Route::get('/admin/admin/add','Admin\AdminController@add');
	Route::post('/admin/admin/insert','Admin\AdminController@insert');
	Route::get('/admin/admin/index','Admin\AdminController@index');
	Route::get('/admin/admin/edit/{id}','Admin\AdminController@edit');
	Route::post('/admin/admin/update','Admin\AdminController@update');
	Route::get('/admin/admin/delete/{id}','Admin\AdminController@delete');
	Route::post('/admin/admin/ajaxUpdate','Admin\AdminController@ajaxUpdate');
	Route::get('/admin/admin/edit_info/{id}','Admin\AdminController@edit_info');
	Route::post('/admin/admin/update_info','Admin\AdminController@update_info');

	//会员管理
	Route::get('/admin/user/member','Admin\UserController@member');
	Route::get('/admin/user/member_level','Admin\UserController@member_level');
	Route::get('/admin/user/add_level','Admin\UserController@add_level');

	Route::get('/admin/user/edit/{id}','Admin\UserController@edit');
	Route::post('/admin/user/update','Admin\UserController@update');
	Route::get('/admin/user/delete/{id}','Admin\UserController@delete');
	Route::post('/admin/user/ajaxUpdate','Admin\UserController@ajaxUpdate');
	Route::post('/admin/user/ajaxUsername','Admin\UserController@ajaxUsername');

	//后台分类管理模块
	Route::get('/admin/cate/add','Admin\CateController@add');
	Route::post('/admin/cate/insert','Admin\CateController@insert');
	Route::get('/admin/cate/index','Admin\CateController@index');
	Route::get('/admin/cate/edit/{id}','Admin\CateController@edit');
	Route::post('/admin/cate/update','Admin\CateController@update');
	Route::get('/admin/cate/delete/{id}','Admin\CateController@delete');


	//商品属性
	Route::controller('/admin/goodsattrs','Admin\GcController');
	//商品图片
	Route::controller('/admin/goodsimgs','Admin\GiController');
	//商标图片
	Route::controller('/admin/goodsbrands','Admin\GbController');

	//商品管理
	Route::controller('/admin/goods','Admin\GoodsController');




	//内容管理
	Route::get('/admin/title/titleList', 'Admin\TitleController@titleList');
	Route::get('/admin/title/titleSpecial', 'Admin\TitleController@titleSpecial');
	Route::get('/admin/title/titleClass', 'Admin\TitleController@titleClass');
	Route::get('/admin/title/article', 'Admin\TitleController@article');
	Route::get('/admin/title/category', 'Admin\TitleController@category');
	Route::get('/admin/title/topic', 'Admin\TitleController@topic');



	//安全退出
	Route::get('/admin/logout', 'Admin\LoginController@logout');

	

});

//验证码路由
Route::get('/kit/captcha/{tmp}', 'Admin\KitController@captcha');

//后台登录
Route::get('/admin/login/', 'Admin\LoginController@login');
Route::post('/admin/dologin', 'Admin\LoginController@doLogin');

Route::resource('/admin/article', 'Admin\ArticleController');




//前台路由
//前台首页
Route::get('/home/index/index','Home\IndexController@index');


Route::get('/home/index2/index2','Home\Index2Controller@index');


//前台注册会员
Route::get('/home/register/register' ,'Home\RegisterController@register');


//注册成功
Route::get('/home/loginwin/loginwin','Home\loginWinController@loginwin');


//前台登录
// Route::get('/home/login/login','Home\LoginController@login');


//床大类
Route::get('/home/bedclass/bedclass','Home\bedClassController@bedclass');


//皮沙发
Route::get('/home/leatherseat/leatherseat','Home\LeatherSeatController@leatherseat');


//我的收藏夹MyFavorite
Route::get('/home/myfavorite/myfavorite','Home\MyFavoriteController@myfavorite');


//data 给人资料
Route::get('/home/data/data','Home\dataController@data');


//myshopping 我的购物车
Route::get('/home/myshopping/myshopping','Home\MyShoppingController@myshopping');


//estimtae 评价晒单
Route::get('/home/estimate/estimate','Home\estimateController@estimate');


//我地址止 myaddress
 Route::get('/home/myaddress/myaddress','Home\MyAddressController@myorder');


 //团购 group
 Route::get('/home/group/group' ,'Home\GroupController@group');


 //我的订单
 Route::get('/home/myorder/myorder','Home\MyOrderController@myorder');


 //账户设置/账户安全account
 Route::get('/home/account/account','Home\AccountController@account');







